<% %> 
<div id="signup_step">
<span>
<h2><%='Sign-up: Step 2 of 2'.t%></h2>
 <p><%='1. Choose your plan'.t%><br/><strong><%='2. Create your account'.t%></strong></p>
 <p><%="You'll be up and running in less than a minute!".t%></p>
</span>
<%=image_tag"step_2.png".t%>
</div>

<div id=signup>
<%form_for :dd,:url=>{:action=>'create_account'},:html=>{:onsubmit=>"return checkform();"} do %>
<fieldset>
  <legend> <%='Plan you select'.t%> </legend>
   <%@plan = Plan.find_by_name(plan) %>
   <div style="padding:5px;border:1px #ccc solid;background-color:#CFC;">
   <%='Plan'.t%>:<strong><%=@plan.name.t%></strong><br>
   <%='Price'.t%>:<strong><%=@plan.price_cn.to_s + "$/month".t%></strong><br/>
   <%='Projects'.t%>:<strong><%=@plan.projects || "unlimited".t%></strong><br/> 
   <%='Storage for file sharing'.t%>:<strong><%=number_to_human_size(@plan.storage_size)%></strong><br/>
   <%='Max file can upload'.t%>:<strong><%=number_to_human_size(@plan.max_size)%></strong>
   </div>
   <br>
   <%=link_to "<< Select again".t,"/signup",:style=>'font-size:12px'%>
</fieldset>
<span class="special">
<fieldset>
  <legend><%='1.Your company/group name'.t%></legend>
   <%=text_field 'company','name',:size=>50,:class=>'big_font' %>*
   <br>
   <span><%='For example'.t%>:<%='Nokia communication,Google inc,etc.'.t%></span>
</fieldset>
<fieldset>
   <legend><%='2. Create your Trikr site address'.t%></legend>
   <div>
    <%='Every Trikr site has its own unique web address. This is where you, your co-workers, and your clients will log-in. Create yours below (letters and numbers only, no spaces):'.t%>
   </div>
   <strong>http://<%=text_field 'company','url',:size=>15,:class=>'big_font'%>.trikr.com</strong>*
   <%=observe_field 'company_url',
                    :update=>'check_url',
					:frequency => 0.5,
					:with =>"'url=' + value",
					:url=>{:action=>"check_url"}
   %>
   <div id="check_url">
   </div>
   <span>
   <strong><%='For example'.t%></strong>, <%="if you wanted AcmeWidgets.trikr.com as your Trikr web address, you'd enter AcmeWidgets into the field above. There's no functional difference between the names just pick the one you like best.".t%>
   </span>
</fieldset>
<fieldset>
   <legend><%='3. Create your administrator account'.t%></legend>
    <%="This is the master log-in for your account. Once you've created your administrator account below, you'll be able to add as many other people and companies to your account as you'd like. Each person will have their own log-in information.".t%>
   <table>
    <%if session[:lang].nil? or session[:lang] == "zh-cn"%>
    <tr>
     <td align=right><%='Last name'.t%><%='First Name'.t%>:</td>
     <td><%=text_field 'user','last_name',:size=>20 %></td>
     </tr>
    <%else%>
    <tr>
     <td align=right><%='First name'.t%>:</td>
     <td><%=text_field 'user','first_name',:size=>20 %></td>
    </tr>
    <tr>
     <td align=right><%='Last name'.t%>:</td>
     <td><%=text_field 'user','last_name',:size=>20 %></td>
    </tr>
    <tr>
    <%end%>
     <td align=right><%='Email'.t%>:</td>
     <td><%=text_field 'user','email',:size=>20%>*</td>
    </tr>
	<tr>
     <td align=right><%='Username'.t%>:</td>
     <td><%=text_field 'user','username',:style=>"width:100px" %>*</td>
    </tr>
    <tr>
     <td align=right><%='Password'.t%>:</td>
     <td><%=password_field 'user','password',:style=>"width:100px" %>* </td>
    </tr>
    <%observe_field 'user_password',
                    :update=>'password_match',
					:frequency => 0.5,
					:with =>"'password=' + value",
					:url=>{:action=>"set_password"}
    %>
    <tr>
     <td align=right><%='Comfirm password'.t%>:</td>
     <td>
	    <%=password_field 'user2','password_c',:style=>"width:100px" %>*
	 </td>
    </tr>
	<tr><td></td><td><span id=password_match></span></td></tr>
    <%observe_field 'user2_password_c',
                    :update=>'password_match',
					:frequency => 1.5,
					:with =>"'password_c=' + value",
					:url=>{:action=>"check_password"}
    %>
   </table>
   *:<%='MUST INPUT FIELD'.t%>
</fieldset>
</span>
<%=hidden_field_tag "plan",@plan.id%>
<br/>
<%=indicator"sign"%>
<span><%=submit_tag "Sign Up Account".t,:class=>'submit_signup',:onclick=>"Element.show('indicator_sign');checkform();"%></span>
<%end%>
<script>
  function checkform() {
    if ( $('user_password').value == '') {
      alert('you should input password');
      return false;
    } 
    if ( $('user_password').value != $('user2_password_c').value) {
      alert('your password is not match');
      return false;
    } 
    if ($('user_username').value == '') {
      alert('you should input username');
      return false;
    } 
    if ($('user_email').value == ''){
      alert('you should input email');
      return false;
    }
    return true;
  }
</script>
</div>
